package day08.thread02.yieldThread;

/**
 * <>
 * <详细描述>
 *
 * @Author WANG.SONG.
 * @Date 2019/3/3 0003 22:46
 * @see
 */
public class YieldThread2 extends Thread {
    @Override
    public void run() {
        super.run();
        long begin = System.currentTimeMillis();
        int count = 0;
        for (int i = 0;i<=5000000; i++){
            Thread.yield();
            count += i;
        }
        long end = System.currentTimeMillis();
        System.out.println("yield用时："+(end-begin) +"毫秒");
    }

}
